package enumstools

import "time"

type TimeEnum struct {
}

var TimeEnumObject TimeEnum

const (
	TimeEnumWorkHoursStartCommon = "09:30:00"
	TimeEnumWorkHoursEndCommon   = "19:00:00"

	TimeEnumWorkHoursStartUnusual = "10:00:00"
	TimeEnumWorkHoursEndUnusual   = "17:30:00"

	//下午1点
	TimeEnumWorkHourPmsStartCommon = "13:00:00"
	TimeEnumWorkHourAmEndCommon    = "12:00:00"

	//
	TimeEnumStartTime      = "00:00:00"
	TimeEnumEmptyStartTime = " 00:00:00"
	TimeEnumEndTime        = "23:59:59"
	TimeEnumEmptyEndTime   = " 23:59:59"

	//日期转换格式
	TimeEnumDateTimeHourLayout    = "2006-01-02 15"
	TimeEnumDateTimeHourAllLayout = "2006-01-02 15:00:00"
	TimeEnumDateTimeLayout        = "2006-01-02 15:04:05"
	TimeEnumDateLayout            = "2006-01-02"
	TimeEnumDateSlashLayout       = "2006/01/02"
	TimeEnumDateLayoutAll         = "2006-01-02 00:00:00"
	TimeEnumDateLayoutNumber      = "20060102"
	TimeEnumTimeLayout            = "15:04:05"

	TimeEnumOutZeroTime            = "0001-01-01 00:00:00"
	TimeEnumOutZeroDateSlashLayout = "0001/01/01"
	TimeEnumOutZeroDate            = "0001-01-01"

	TimeWeekSundayString    = "Sunday"    //星期日
	TimeWeekMondayString    = "Monday"    //星期1
	TimeWeekTuesdayString   = "Tuesday"   //星期2
	TimeWeekWednesdayString = "Wednesday" //星期3
	TimeWeekThursdayString  = "Thursday"  //星期4
	TimeWeekFridayString    = "Friday"    //星期5
	TimeWeekSaturdayString  = "Saturday"  //星期6
)

func (e TimeEnum) GetWeekNumber(tmp time.Time) int {
	data := map[string]int{
		TimeWeekSundayString:    0,
		TimeWeekMondayString:    1,
		TimeWeekTuesdayString:   2,
		TimeWeekWednesdayString: 3,
		TimeWeekThursdayString:  4,
		TimeWeekFridayString:    5,
		TimeWeekSaturdayString:  6,
	}
	return data[tmp.Weekday().String()]
}

func (e TimeEnum) GetWeekNumberSpecial(tmp time.Time) int {
	data := map[string]int{
		TimeWeekSundayString:    7,
		TimeWeekMondayString:    1,
		TimeWeekTuesdayString:   2,
		TimeWeekWednesdayString: 3,
		TimeWeekThursdayString:  4,
		TimeWeekFridayString:    5,
		TimeWeekSaturdayString:  6,
	}
	return data[tmp.Weekday().String()]
}
